package com.example.intercepter;

import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@Component
public class SingleSignOnInterceptor implements HandlerInterceptor {

    @Override
    public void afterCompletion(HttpServletRequest request, HttpServletResponse response, Object handler, Exception ex) throws Exception {
        // 在这里添加单点登录后的逻辑
        // 例如，检查特定的请求参数或头部信息
        if (request.getRequestURI().contains("/test/getRedis")) {
            // 如果满足特定条件，执行相应的逻辑
            System.out.println("redisInteceptoer");
        }
    }
}